package senpec.qc.harmony.instrument.equipment;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Entity;
import lombok.*;
import senpec.qc.harmony.base.mybatisplus.IBaseEntity;
import tools.jackson.databind.annotation.JsonDeserialize;
import tools.jackson.databind.annotation.JsonSerialize;
import tools.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import tools.jackson.datatype.jsr310.ser.LocalDateSerializer;

import java.time.LocalDate;

@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@NoArgsConstructor(force = true)
@AllArgsConstructor
@Entity(name = "harmony_instrument_equipment")
@TableName("harmony_instrument_equipment")
public class Equipment extends IBaseEntity<Equipment> {
    private String name;
    private String model;
    private String serialNo;
    private String status;//设备状态：正常、故障、报废
    private String manufacturer;//制造厂
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate startDate;//购买日期
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate endDate;//报废日期

}
